home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / Rexx / EmbossAnim.pprx < prev    next >
Text File  |  2000-05-08  |  3KB  |  122 lines

  1. /* Personal Paint Amiga Rexx script - Copyright © 1995-1997 Cloanto Italia srl */
  2.  
  3. /* $VER: EmbossAnim.pprx 1.0 */
  4.  
  5. /** ENG
  6.  This script applies the emboss filter to the current animation. This
  7.  script is mainly intended as a component that can be modified, extended
  8.  or otherwise integrated with other programs.
  9. */
  10.  
  11. /** DEU
  12.  Mit diesem Skript läßt sich der Relieffilter auf die aktuelle
  13.  Animation anwenden. Es läßt sich darüber hinaus auch als Komponente
  14.  für andere Operationen verwenden und entsprechend modifizieren,
  15.  erweitern oder auf anderem Wege mit anderen Programmen nutzen.
  16. */
  17.  
  18. /** ITA
  19.  Questo script applica il filtro a sbalzo (emboss) all'animazione corrente.
  20.  Si può considerare questo script come un componente che si può modificare,
  21.  estendere o integrare in altri modi all'interno di altri programmi.
  22. */
  23.  
  24. IF ARG(1, EXISTS) THEN
  25.     PARSE ARG PPPORT
  26. ELSE
  27.     PPPORT = 'PPAINT'
  28.  
  29. IF ~SHOW('P', PPPORT) THEN DO
  30.     IF EXISTS('PPaint:PPaint') THEN DO
  31.         ADDRESS COMMAND 'Run >NIL: PPaint:PPaint'
  32.         DO 30 WHILE ~SHOW('P',PPPORT)
  33.              ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  34.         END
  35.     END
  36.     ELSE DO
  37.         SAY "Personal Paint could not be loaded."
  38.         EXIT 10
  39.     END
  40. END
  41.  
  42. IF ~SHOW('P', PPPORT) THEN DO
  43.     SAY 'Personal Paint Rexx port could not be opened'
  44.     EXIT 10
  45. END
  46.  
  47. ADDRESS VALUE PPPORT
  48. OPTIONS RESULTS
  49. OPTIONS FAILAT 10000
  50.  
  51. Get 'LANG'
  52. IF RESULT = 1 THEN DO        /* Deutsch */
  53.     txt_req_load      = 'Animation auswählen'
  54.     txt_err_abort     = 'Verarbeitung wurde abgebrochen'
  55.     txt_err_proc      = 'Fehler bei der Verarbeitung: '
  56.     txt_err_oldclient = 'Für dieses Skript_ist eine neuere Version_von Personal Paint erforderlich'
  57. END
  58. ELSE IF RESULT = 2 THEN DO        /* Italiano */
  59.     txt_req_load      = 'Selezionare animazione'
  60.     txt_err_abort     = 'Elaborazione annullata'
  61.     txt_err_proc      = 'Errore nell''elaborazione: '
  62.     txt_err_oldclient = 'Questa procedura richiede_una versione più recente_di Personal Paint'
  63. END
  64. ELSE DO        /* English */
  65.     txt_req_load      = 'Select Animation'
  66.     txt_err_abort     = 'User abort during processing'
  67.     txt_err_proc      = 'Error during processing: '
  68.     txt_err_oldclient = 'This script requires a newer_version of Personal Paint'
  69. END
  70.  
  71. Version 'REXX'
  72. IF RESULT < 7 THEN DO
  73.     RequestNotify 'PROMPT "'txt_err_oldclient'"'
  74.     EXIT 10
  75. END
  76.  
  77. /*
  78.    Change the variable below to use another filter
  79.    and/or edit and use a Set command such as the following one
  80. */
  81.  
  82. filtername = 'Emboss High'
  83.  
  84. /*
  85.    Set '"FILTER = ""Emboss High"", 0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,1,0,-1,  0,0,0,-1,-1,  1, 204,0,0"'
  86. */
  87.  
  88. LockGUI
  89. GetFrames
  90. frames = RESULT
  91. IF frames = 0 THEN DO
  92.     RequestFile '"'txt_req_load'"'
  93.     IF RC = 0 THEN DO
  94.         LoadAnimation RESULT 'NEW'
  95.         GetFrames
  96.         frames = RESULT
  97.     END
  98. END
  99. IF frames > 0 THEN DO
  100.     GetFramePosition
  101.     savepos = RESULT
  102.     errcode = 0
  103.     SetFramePosition 1
  104.     DO fnum = 1 TO frames
  105.         Process '"'filtername'"'
  106.         IF RC ~= 0 THEN DO
  107.             IF RC = 5 THEN
  108.                 errmess = txt_err_abort
  109.             ELSE
  110.                 errmess = txt_err_proc || RC
  111.             errcode = RC
  112.             LEAVE
  113.         END
  114.         SetFramePosition 'NEXT'
  115.     END
  116.     IF errcode > 0 THEN
  117.         RequestNotify 'PROMPT "'errmess'"'
  118.  
  119.     SetFramePosition savepos
  120. END
  121. UnlockGUI
  122.